Skip to content

Stab in the dark attempt at fixing the Windows CI#647

Closed
notroj wants to merge 5 commits into
apache:trunkfrom
notroj:maybe-fix-windows-ci
Closed

Stab in the dark attempt at fixing the Windows CI#647
notroj wants to merge 5 commits into
apache:trunkfrom
notroj:maybe-fix-windows-ci

Conversation

@notroj
Copy link
Copy Markdown
Collaborator

@notroj notroj commented May 15, 2026

No description provided.

notroj and others added 5 commits May 15, 2026 11:53
* CMakeLists.txt: Fix CMake generation failure with non-MSVC
  compilers (e.g. MinGW GCC) caused by unconditional use of
  $<TARGET_PDB_FILE:...> generator expressions, which are only
  supported by the MSVC linker.  Guard all TARGET_PDB_FILE usage
  with IF(INSTALL_PDB), and default INSTALL_PDB to OFF for
  non-MSVC compilers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* CMakeLists.txt: TARGET_COMPILE_DEFINITIONS does not correctly handle
  values with spaces for MinGW windres, which invokes cc1.exe as its
  preprocessor.  Defines like LONG_NAME="Apache HTTP Server htdbm
  program" get split on spaces, causing "fatal error: HTTP\: No such
  file or directory" and similar errors.  LONG_NAME, BIN_NAME,
  APP_FILE, and ICON_FILE are only used in build/win32/httpd.rc, so
  generate per-target wrapper .rc files with these defines baked in as
  #define directives, then #include the real httpd.rc.  This avoids
  command-line quoting entirely.
  Also fix TARGET_COMPILE_OPTIONS in the standard_support FOREACH loop
  which incorrectly referenced ${mod_name} from the outer modules loop
  instead of ${pgm}.

Claude's explanation of the root cause:

  Root cause: Commit ed4ffd0 replaced the DEFINE_WITH_BLANKS() macro with
  TARGET_COMPILE_DEFINITIONS(), which correctly handles spaces for the C compiler but NOT for MinGW's
  windres.exe. The resource compiler invokes cc1.exe as its preprocessor, and -DLONG_NAME="Apache HTTP
  Server htdbm program" gets split on spaces — each word after Apache gets treated as an input file,
  causing the fatal error: HTTP\: No such file or directory errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* CMakeLists.txt (GENERATE_RC_FILE): For MinGW, compile the .rc file
  via ADD_CUSTOM_COMMAND with only the include paths actually needed
  by httpd.rc (just ${CMAKE_SOURCE_DIR}/include for ap_release.h).
  This avoids passing all target include directories to windres, which
  cannot handle -I paths containing spaces such as the default
  CMAKE_INSTALL_PREFIX of "C:/Program Files (x86)/HTTPD/include".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* CMakeLists.txt: ap_config.h includes ap_config_auto.h when
  __MINGW32__ is defined, but autoconf is not used in the CMake
  build so the file does not exist.  Generate an empty one in the
  build directory to satisfy the include.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* modules/arch/win32/mod_win32.c (set_interpreter_source): Change
  third parameter from char * to const char * to match the
  AP_INIT_TAKE1 function signature.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@notroj
Copy link
Copy Markdown
Collaborator Author

notroj commented May 15, 2026

Made it worse, I give up.

@notroj notroj closed this May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant